cmake_minimum_required(VERSION 3.16)
project(cpp20_recipes)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED on)
set(CMAKE_CXX_COMPILE_FEATURES)
set(CMAKE_CXX_FLAGS "${CAMKE_CXX_FLAGS} -std=c++20 -pthread")

if (EXISTS /usr/local/bin/gcc)
    set(CMAKE_C_COMPILER "/usr/local/bin/gcc")
    set(CMAKE_CXX_COMPILER "/usr/local/bin/g++")
elseif(EXISTS /usr/bin/gcc)
    set(CMAKE_C_COMPILER "/usr/bin/gcc")
    set(CMAKE_CXX_COMPILER "/usr/bin/g++")
else()
    message(STATUS "没有编译器可用")
    return()
endif ()

add_executable(keywords_auto keywords_auto.cpp keywords_auto.h )
add_executable(auto_ctr auto_ctr.cpp auto_ctr.h)
add_executable(auto_structured_bind auto_structured_bind.cpp auto_structured_bind.h)
add_executable(lambda_calculus lambda_calculus.cpp lambda_calculus.h)
add_executable(init_member init_member.cpp init_member.h)
add_executable(file_manager FileManager.cpp FileManager.h)